﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Presenter.Support;
using MS.InformationManagement.BLL.ShippingControlTemplates;
using MS.InformationManagement.DAL.DTOs;
using MS.InformationManagement.Core.TransactionsResponse;


namespace MS.InformationManagement.Presenter.ShippingControlTemplates
{
    public class ShippingControlTemplatesPresenter : BasePresenter<IShippingControlTemplatesView>
    {
        #region Constructors

        public ShippingControlTemplatesPresenter(IShippingControlTemplatesView view) : base(view) { }

        #endregion

        #region Public Methods

        public void HandleLoad()
        {
            View.MotivosRechazo = MS.InformationManagement.BLL.ShippingControlTemplates.ShippingControlTemplates.GetMotivosEnvio();
            //View.foundRadicados = MS.InformationManagement.BLL.ShippingControlTemplates.ShippingControlTemplates.SearchRadicados();
            View.Show();
        }

        public void HandleSearch()
        {
            View.foundRadicados = MS.InformationManagement.BLL.ShippingControlTemplates.ShippingControlTemplates.SearchRadicados(View.IdRadicado);
            View.MotivosRechazo = MS.InformationManagement.BLL.ShippingControlTemplates.ShippingControlTemplates.GetMotivosEnvio();
            View.ShowSearch();
        }


        public void UpdateStatusShipping()
        {

            ShippingControlTemplatesCommand ShippingCommand = new ShippingControlTemplatesCommand(View.foundRadicados);
            DeliveryFormCreationResponse _shippingResponse = ShippingCommand.Execute() as DeliveryFormCreationResponse;
            View.ShippingResponse = _shippingResponse;
            View.ShowMessage();

        }

        #endregion
    }
}
